<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>基于R语言的excel文件合成操作 | 小谭的部落阁</title><meta name="keywords" content="excel,文件操作,数据合并,R语言"><meta name="author" content="谭自财"><meta name="copyright" content="谭自财"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="主要实现效果 元数据文件    元数据文件2    合成后文件   安装需要的包#读写excel1文件相关的包install.packages(&quot;readxl&quot;)#对数据进行整理的包，包括管道符号的使用install.packages(&quot;tidyverse&quot;)  数据处理#记得切换工作目录list.files(pattern &#x3D; &quot;*.xlsx&amp;q">
<meta property="og:type" content="article">
<meta property="og:title" content="基于R语言的excel文件合成操作">
<meta property="og:url" content="https://tanzicai.gitee.io/2021/07/28/%E5%9F%BA%E4%BA%8ER%E8%AF%AD%E8%A8%80%E7%9A%84excel%E5%90%88%E5%B9%B6%E6%93%8D%E4%BD%9C/index.html">
<meta property="og:site_name" content="小谭的部落阁">
<meta property="og:description" content="主要实现效果 元数据文件    元数据文件2    合成后文件   安装需要的包#读写excel1文件相关的包install.packages(&quot;readxl&quot;)#对数据进行整理的包，包括管道符号的使用install.packages(&quot;tidyverse&quot;)  数据处理#记得切换工作目录list.files(pattern &#x3D; &quot;*.xlsx&amp;q">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://tanzicai.gitee.io/img/BRLY.png">
<meta property="article:published_time" content="2021-07-28T08:06:49.939Z">
<meta property="article:modified_time" content="2021-07-11T09:06:40.000Z">
<meta property="article:author" content="谭自财">
<meta property="article:tag" content="excel">
<meta property="article:tag" content="文件操作">
<meta property="article:tag" content="数据合并">
<meta property="article:tag" content="R语言">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://tanzicai.gitee.io/img/BRLY.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://tanzicai.gitee.io/2021/07/28/%E5%9F%BA%E4%BA%8ER%E8%AF%AD%E8%A8%80%E7%9A%84excel%E5%90%88%E5%B9%B6%E6%93%8D%E4%BD%9C/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"简"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '基于R语言的excel文件合成操作',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-07-11 17:06:40'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const fontSizeVal = saveToLocal.get('global-font-size')
    if (fontSizeVal !== undefined) {
      document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
    }
    })(window)</script><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="小谭的部落阁" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://gitee.com/tanzicai/drawingbed/raw/master/img/20210609205810.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">35</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">50</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">12</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标籤</span></a></div><div class="menus_item"><a class="site-page" href="/category/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/fridends/"><i class="fa-fw fa fa-heartbeat"></i><span> 朋友圈</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/download/"><i class="fa-fw fas fa--cloud-download"></i><span> 下载</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-hear"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/img/BRLY.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">小谭的部落阁</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标籤</span></a></div><div class="menus_item"><a class="site-page" href="/category/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/fridends/"><i class="fa-fw fa fa-heartbeat"></i><span> 朋友圈</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/download/"><i class="fa-fw fas fa--cloud-download"></i><span> 下载</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-hear"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">基于R语言的excel文件合成操作</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-07-28T08:06:49.939Z" title="发表于 2021-07-28 16:06:49">2021-07-28</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-07-11T09:06:40.000Z" title="更新于 2021-07-11 17:06:40">2021-07-11</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/excel%E6%93%8D%E4%BD%9C/">excel操作</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="基于R语言的excel文件合成操作"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="主要实现效果"><a href="#主要实现效果" class="headerlink" title="主要实现效果"></a>主要实现效果</h2><blockquote>
<p>元数据文件</p>
</blockquote>
<p><img src="https://gitee.com/tanzicai/drawingbed/raw/master/img/%E5%85%83%E6%95%B0%E6%8D%AE%E6%96%87%E4%BB%B61.png" alt="image-20210606210235695"></p>
<blockquote>
<p>元数据文件2</p>
</blockquote>
<p><img src="https://gitee.com/tanzicai/drawingbed/raw/master/img/%E5%85%83%E6%95%B0%E6%8D%AE%E6%96%87%E4%BB%B62.png" alt="image-20210606210334771"></p>
<blockquote>
<p>合成后文件</p>
</blockquote>
<p><img src="https://gitee.com/tanzicai/drawingbed/raw/master/img/%E5%90%88%E6%88%90%E5%90%8E%E6%96%87%E4%BB%B6.png" alt="image-20210606210435148"></p>
<h3 id="安装需要的包"><a href="#安装需要的包" class="headerlink" title="安装需要的包"></a>安装需要的包</h3><figure class="highlight r"><table><tr><td class="code"><pre><span class="line"><span class="comment">#读写excel1文件相关的包</span></span><br><span class="line">install.packages(<span class="string">&quot;readxl&quot;</span>)</span><br><span class="line"><span class="comment">#对数据进行整理的包，包括管道符号的使用</span></span><br><span class="line">install.packages(<span class="string">&quot;tidyverse&quot;</span>)</span><br></pre></td></tr></table></figure>

<h3 id="数据处理"><a href="#数据处理" class="headerlink" title="数据处理"></a>数据处理</h3><figure class="highlight r"><table><tr><td class="code"><pre><span class="line"><span class="comment">#记得切换工作目录</span></span><br><span class="line">list.files(pattern = <span class="string">&quot;*.xlsx&quot;</span>,full.names = <span class="literal">TRUE</span>)%&gt;%</span><br><span class="line">lapply(readxl::read_excel)%&gt;%</span><br><span class="line">reduce(full_join,by=<span class="string">&quot;miRNA&quot;</span>)%&gt;%</span><br><span class="line">arrange(miRNA)%&gt;%</span><br><span class="line">select(contains(<span class="string">&quot;RNA&quot;</span>)|contains(<span class="string">&quot;Gene&quot;</span>))-&gt;df</span><br><span class="line">df = df[!<span class="built_in">is.na</span>(df$Gene),]</span><br><span class="line">write.csv(df,file = <span class="string">&quot;处理后数据.csv&quot;</span>,<span class="built_in">quote</span> = <span class="built_in">F</span> ,row.names=<span class="built_in">T</span>,na=<span class="string">&quot;&quot;</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="string">&#x27;list.files&#x27;</span>:遍历目录下的文件</span><br><span class="line"><span class="string">&#x27;pattern&#x27;</span> :文件名筛选</span><br><span class="line"><span class="string">&#x27;full.names&#x27;</span> :是否带完整路径读入</span><br><span class="line"><span class="string">&#x27;%&gt;%&#x27;</span>(管道符):将读取的数据传递给下一个函数，作为下一函数的初始数据</span><br><span class="line"><span class="string">&#x27;lapply&#x27;</span>：循环读取每一个文件里面的数据，并以数组[<span class="number">1</span>][<span class="number">2</span>]。。。分别把每个文件的表格读取进来</span><br><span class="line"><span class="string">&#x27;by&#x27;</span>:通过by后面的关键词进行合并</span><br><span class="line"><span class="string">&#x27;reduce&#x27;</span>：以关键词进行排序</span><br><span class="line"><span class="string">&#x27;select&#x27;</span>:选择有效列</span><br><span class="line"><span class="string">&#x27;file&#x27;</span> = <span class="string">&quot;文件名&quot;</span></span><br><span class="line"><span class="string">&#x27;quote&#x27;</span>:字符串数据导出是否带引号</span><br><span class="line"></span><br><span class="line"><span class="comment">## 其他情况实例</span></span><br><span class="line"><span class="comment">### 多个数据表列名相同按行合并</span></span><br><span class="line"></span><br><span class="line">**注意：当数据文件分布在多个子文件夹时，可以使用 recursive = <span class="literal">TRUE</span>读取该文件夹下的所有文件（包括子文件夹里面）**</span><br><span class="line"></span><br><span class="line">​```R</span><br><span class="line">files = list.files(pattern = &quot;xlsx&quot;, full.names = TRUE)</span><br><span class="line">df = map_dfr(files, read_xlsx)    # 批量读取+按行堆叠合并</span><br></pre></td></tr></table></figure>
<h3 id="多个sheet（工作表）列名相同按行合并"><a href="#多个sheet（工作表）列名相同按行合并" class="headerlink" title="多个sheet（工作表）列名相同按行合并"></a>多个sheet（工作表）列名相同按行合并</h3><figure class="highlight r"><table><tr><td class="code"><pre><span class="line"><span class="comment">#path=path = &quot;路径/文件名.xlsx&quot;</span></span><br><span class="line">df &lt;- map_dfr(excel_sheets(path),read_xlsx(path, sheet = .x))  <span class="comment"># 批量读取+按行堆叠合并  </span></span><br></pre></td></tr></table></figure>
<h3 id="多个数据表列名不完全相同，进行数据连接-本文实现情况"><a href="#多个数据表列名不完全相同，进行数据连接-本文实现情况" class="headerlink" title="多个数据表列名不完全相同，进行数据连接(本文实现情况)"></a>多个数据表列名不完全相同，进行数据连接(本文实现情况)</h3><figure class="highlight r"><table><tr><td class="code"><pre><span class="line">files = list.files(<span class="string">&quot;datas/&quot;</span>, pattern = <span class="string">&quot;xlsx&quot;</span>, full.names = <span class="literal">TRUE</span>)</span><br><span class="line">df = map(files, read_xlsx) %&gt;% </span><br><span class="line">  reduce(full_join, by = <span class="string">&quot;人名&quot;</span>)                  <span class="comment"># 读入并依次做全连接</span></span><br></pre></td></tr></table></figure>

<h3 id="多个sheet列名不完全相同，进行数据连接-本文实现情况"><a href="#多个sheet列名不完全相同，进行数据连接-本文实现情况" class="headerlink" title="多个sheet列名不完全相同，进行数据连接(本文实现情况)"></a>多个sheet列名不完全相同，进行数据连接(本文实现情况)</h3><figure class="highlight r"><table><tr><td class="code"><pre><span class="line"><span class="comment">#path = 路径/文件名.xlsx</span></span><br><span class="line">df &lt;- map(excel_sheets(path), read_xlsx(path, sheet = .)) %&gt;% </span><br><span class="line">  reduce(full_join, by = <span class="string">&quot;人名&quot;</span>)              <span class="comment"># 读入并依次做全连接</span></span><br></pre></td></tr></table></figure>

<h2 id="数据修改"><a href="#数据修改" class="headerlink" title="数据修改"></a>数据修改</h2><h3 id="安装包及导入数据"><a href="#安装包及导入数据" class="headerlink" title="安装包及导入数据"></a>安装包及导入数据</h3><p>R中，XLConnnect和openxlsx包来处理Excel文件，XLConnnect依赖于Java，我们选择openxlsx包。R在导入源数据的时候注意导入路径，如果路径过长，中文等，会出现导入错误。</p>
<figure class="highlight r"><table><tr><td class="code"><pre><span class="line"><span class="comment">#首先安装并且导入openxlsx包</span></span><br><span class="line">&gt; install.packages(<span class="string">&quot;openxlsx&quot;</span>)</span><br><span class="line">Installing package into ‘D:/用户目录/我的文档/R/win-library/<span class="number">3.3</span>’(as ‘lib’ is unspecified)</span><br><span class="line">trying URL</span><br><span class="line"><span class="string">&#x27;https://cran.rstudio.com/bin/windows/contrib/3.3/openxlsx_4.0.0.zip&#x27;</span></span><br><span class="line">Content type <span class="string">&#x27;application/zip&#x27;</span> <span class="built_in">length</span></span><br><span class="line"><span class="number">2379870</span> bytes (<span class="number">2.3</span> MB)</span><br><span class="line">downloaded <span class="number">2.3</span> MB</span><br><span class="line">package ‘openxlsx’ successfully unpacked</span><br><span class="line">and MD5 sums checked</span><br><span class="line">The downloaded binary packages are <span class="keyword">in</span></span><br><span class="line">      C:\Users\Administrator\AppData\Local\Temp\RtmpiKWFIy\downloaded_packages </span><br><span class="line"><span class="comment">#导入数据 </span></span><br><span class="line">&gt; library(<span class="string">&quot;openxlsx&quot;</span>)</span><br><span class="line">&gt; readFilepath &lt;- <span class="string">&quot;文件路径/文件名.xlsx&quot;</span></span><br><span class="line"><span class="comment">#注意路径书写，绝对路径、相对路径均可，注意相对路径的时候工作区的设置</span></span><br><span class="line">&gt; exceldata &lt;- read.xlsx(readFilepath,<span class="string">&quot;Sheet1&quot;</span>)<span class="comment">#读入数据</span></span><br><span class="line">&gt; View(exceldata)</span><br><span class="line"><span class="comment">#查看导入的Excel数据</span></span><br></pre></td></tr></table></figure>
<h3 id="数据预处理"><a href="#数据预处理" class="headerlink" title="数据预处理"></a>数据预处理</h3><h4 id="列名重命名"><a href="#列名重命名" class="headerlink" title="列名重命名"></a>列名重命名</h4><p>列名重命名：源数据中列名都是中文，为了保证编码的正常运行，对其进行英文重命名</p>
<figure class="highlight r"><table><tr><td class="code"><pre><span class="line"><span class="built_in">names</span>(exceldata) &lt;- <span class="built_in">c</span>(<span class="string">&quot;time&quot;</span>,<span class="string">&quot;cardno&quot;</span>,<span class="string">&quot;drugId&quot;</span>,<span class="string">&quot;drugName&quot;</span>,<span class="string">&quot;saleNumber&quot;</span>,<span class="string">&quot;virtualmoney&quot;</span>,<span class="string">&quot;actualmoney&quot;</span>)</span><br></pre></td></tr></table></figure>
<h3 id="删除缺失值"><a href="#删除缺失值" class="headerlink" title="删除缺失值"></a>删除缺失值</h3><p>删除缺失值：缺失值以符号NA</p>
<figure class="highlight r"><table><tr><td class="code"><pre><span class="line">exceldata &lt;- exceldata[!<span class="built_in">is.na</span>(exceldata$time),]</span><br></pre></td></tr></table></figure>

<h3 id="处理日期"><a href="#处理日期" class="headerlink" title="处理日期"></a><strong>处理日期</strong></h3><p><strong>处理日期</strong>：源数据中time列日期是以字符串的形式出现的（日期+星期），为了便于数据分析，需要将字符串拆分为相应的单列字符。</p>
<figure class="highlight r"><table><tr><td class="code"><pre><span class="line">str_split_fixed 函数使用前，先使用 nstall.packages (stringr) 安装，再使用 library (stringr) 引用该包</span><br><span class="line">library(stringr)</span><br><span class="line">timesplit &lt;-str_split_fixed(exceldata$time,<span class="string">&quot; &quot;</span>,n=<span class="number">2</span>)</span><br><span class="line"><span class="comment"># time里的字符串被成功分成两列字符</span></span><br><span class="line">exceldata$time &lt;- timesplit[,<span class="number">1</span>]</span><br></pre></td></tr></table></figure>
<p><img src="https://gitee.com/tanzicai/drawingbed/raw/master/img/20210606212216.png" alt="img"></p>
<p>字段拆分：</p>
<figure class="highlight r"><table><tr><td class="code"><pre><span class="line">字段分割函数： str_split_fixed (x, split, n)</span><br><span class="line">x：需要处理的字段/字符</span><br><span class="line">split：用于分割的字符串</span><br><span class="line">n：分隔为多少列</span><br><span class="line">返回值： data.frame</span><br><span class="line"><span class="number">4</span>、数据类型转换：由于运算的需要，需将Time中的字符型向量由“character”转换为以数值形式存储的日期变量，函数as.Date（）用于执行这种转化。</span><br><span class="line">&gt; exceldata$time &lt;-</span><br><span class="line">as.Date(exceldata$time,<span class="string">&quot;%Y-%m-%d&quot;</span>)</span><br><span class="line">&gt; <span class="built_in">class</span>(exceldata$time)</span><br><span class="line">[<span class="number">1</span>] <span class="string">&quot;Date&quot;</span></span><br><span class="line"><span class="comment">#销售数量、应收金额以及实收金额（&quot;SaleNumber&quot;、&quot;Virtualmoney&quot;以及&quot;Actualmoney&quot;）这些数据也都可以转换为数值类型</span></span><br><span class="line"></span><br><span class="line">&gt; exceldata$saleNumber  &lt;-</span><br><span class="line"><span class="built_in">as.numeric</span>(exceldata$saleNumber)</span><br><span class="line">&gt; <span class="built_in">class</span>(exceldata$saleNumber)</span><br><span class="line">[<span class="number">1</span>] <span class="string">&quot;numeric&quot;</span></span><br><span class="line">&gt; exceldata$virtualmoney &lt;-</span><br><span class="line"><span class="built_in">as.numeric</span>(exceldata$virtualmoney)</span><br><span class="line">&gt; exceldata$actualmoney &lt;- <span class="built_in">as.numeric</span>(exceldata$actualmoney)</span><br></pre></td></tr></table></figure>



<h2 id="数据排序"><a href="#数据排序" class="headerlink" title="数据排序"></a>数据排序</h2><figure class="highlight r"><table><tr><td class="code"><pre><span class="line">exceldata &lt;- exceldata[order(exceldata$time,decreasing=<span class="literal">FALSE</span>),]</span><br></pre></td></tr></table></figure>



<p><img src="https://gitee.com/tanzicai/drawingbed/raw/master/img/20210606212216.png" alt="img"></p>
<h1 id="本文使用工具包手册参考地址"><a href="#本文使用工具包手册参考地址" class="headerlink" title="本文使用工具包手册参考地址"></a>本文使用工具包手册参考地址</h1><p><a target="_blank" rel="noopener" href="https://tidyverse.tidyverse.org/">tidyverse</a></p>
<h1 id="部分参考片段"><a href="#部分参考片段" class="headerlink" title="部分参考片段"></a>部分参考片段</h1><h3 id="Overview"><a href="#Overview" class="headerlink" title="Overview"></a>Overview</h3><p>The tidyverse is a set of packages that work in harmony because they share common data representations and API design. The <strong>tidyverse</strong> package is designed to make it easy to install and load core packages from the tidyverse in a single command.</p>
<p>If you’d like to learn how to use the tidyverse effectively, the best place to start is <a target="_blank" rel="noopener" href="https://r4ds.had.co.nz/">R for data science</a>.</p>
<h3 id="Installation"><a href="#Installation" class="headerlink" title="Installation"></a>Installation</h3><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># Install from CRAN</span><br><span class="line">install.packages(&quot;tidyverse&quot;)</span><br><span class="line"></span><br><span class="line"># Or the development version from GitHub</span><br><span class="line"># install.packages(&quot;devtools&quot;)</span><br><span class="line">devtools::install_github(&quot;tidyverse/tidyverse&quot;)</span><br></pre></td></tr></table></figure>

<h3 id="Usage"><a href="#Usage" class="headerlink" title="Usage"></a>Usage</h3><p><code>library(tidyverse)</code> will load the core tidyverse packages:</p>
<ul>
<li><a target="_blank" rel="noopener" href="https://ggplot2.tidyverse.org/">ggplot2</a>, for data visualisation.</li>
<li><a target="_blank" rel="noopener" href="https://dplyr.tidyverse.org/">dplyr</a>, for data manipulation.</li>
<li><a target="_blank" rel="noopener" href="https://tidyr.tidyverse.org/">tidyr</a>, for data tidying.</li>
<li><a target="_blank" rel="noopener" href="https://readr.tidyverse.org/">readr</a>, for data import.</li>
<li><a target="_blank" rel="noopener" href="https://purrr.tidyverse.org/">purrr</a>, for functional programming.</li>
<li><a target="_blank" rel="noopener" href="https://tibble.tidyverse.org/">tibble</a>, for tibbles, a modern re-imagining of data frames.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/tidyverse/stringr">stringr</a>, for strings.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/tidyverse/forcats">forcats</a>, for factors.</li>
</ul>
<p>You also get a condensed summary of conflicts with other packages you have loaded:</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">library(tidyverse)</span><br><span class="line">#&gt; ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──</span><br><span class="line">#&gt; ✓ ggplot2 3.3.3     ✓ purrr   0.3.4</span><br><span class="line">#&gt; ✓ tibble  3.1.0     ✓ dplyr   1.0.5</span><br><span class="line">#&gt; ✓ tidyr   1.1.3     ✓ stringr 1.4.0</span><br><span class="line">#&gt; ✓ readr   1.4.0     ✓ forcats 0.5.1</span><br><span class="line">#&gt; ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──</span><br><span class="line">#&gt; x dplyr::filter() masks stats::filter()</span><br><span class="line">#&gt; x dplyr::lag()    masks stats::lag()</span><br></pre></td></tr></table></figure>

<p>You can see conflicts created later with <code>tidyverse_conflicts()</code>:</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">library(MASS)</span><br><span class="line">#&gt; </span><br><span class="line">#&gt; Attaching package: &#x27;MASS&#x27;</span><br><span class="line">#&gt; The following object is masked from &#x27;package:dplyr&#x27;:</span><br><span class="line">#&gt; </span><br><span class="line">#&gt;     select</span><br><span class="line">tidyverse_conflicts()</span><br><span class="line">#&gt; ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──</span><br><span class="line">#&gt; x dplyr::filter() masks stats::filter()</span><br><span class="line">#&gt; x dplyr::lag()    masks stats::lag()</span><br><span class="line">#&gt; x MASS::select()  masks dplyr::select()</span><br></pre></td></tr></table></figure>

<p>And you can check that all tidyverse packages are up-to-date with <code>tidyverse_update()</code>:</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">tidyverse_update()</span><br><span class="line">#&gt; The following packages are out of date:</span><br><span class="line">#&gt;  * broom (0.4.0 -&gt; 0.4.1)</span><br><span class="line">#&gt;  * DBI   (0.4.1 -&gt; 0.5)</span><br><span class="line">#&gt;  * Rcpp  (0.12.6 -&gt; 0.12.7)</span><br><span class="line">#&gt; Update now?</span><br><span class="line">#&gt; </span><br><span class="line">#&gt; 1: Yes</span><br><span class="line">#&gt; 2: No</span><br></pre></td></tr></table></figure>

<h3 id="Packages"><a href="#Packages" class="headerlink" title="Packages"></a>Packages</h3><p>As well as the core tidyverse, installing this package also installs a selection of other packages that you’re likely to use frequently, but probably not in every analysis. This includes packages for:</p>
<ul>
<li>Working with specific types of vectors:<ul>
<li><a target="_blank" rel="noopener" href="https://github.com/tidyverse/hms">hms</a>, for times.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/tidyverse/lubridate">lubridate</a>, for date/times.</li>
</ul>
</li>
<li>Importing other types of data:<ul>
<li><a target="_blank" rel="noopener" href="https://github.com/wesm/feather">feather</a>, for sharing with Python and other languages.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/tidyverse/haven">haven</a>, for SPSS, SAS and Stata files.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/r-lib/httr">httr</a>, for web apis.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/jeroen/jsonlite">jsonlite</a> for JSON.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/tidyverse/readxl">readxl</a>, for <code>.xls</code> and <code>.xlsx</code> files.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/tidyverse/rvest">rvest</a>, for web scraping.</li>
<li><a target="_blank" rel="noopener" href="https://github.com/r-lib/xml2">xml2</a>, for XML.</li>
</ul>
</li>
<li>Modelling<ul>
<li><a target="_blank" rel="noopener" href="https://github.com/tidyverse/modelr">modelr</a>, for modelling within a pipeline</li>
<li><a target="_blank" rel="noopener" href="https://github.com/tidymodels/broom">broom</a>, for turning models into tidy data</li>
</ul>
</li>
</ul>
<h3 id="Code-of-Conduct"><a href="#Code-of-Conduct" class="headerlink" title="Code of Conduct"></a>Code of Conduct</h3><p>Please note that the tidyverse project is released with a <a target="_blank" rel="noopener" href="https://tidyverse.tidyverse.org/CODE_OF_CONDUCT.html">Contributor Code of Conduct</a>. By contributing to this project, you agree to abide by its terms.</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">谭自财</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://tanzicai.gitee.io/2021/07/28/%E5%9F%BA%E4%BA%8ER%E8%AF%AD%E8%A8%80%E7%9A%84excel%E5%90%88%E5%B9%B6%E6%93%8D%E4%BD%9C/">https://tanzicai.gitee.io/2021/07/28/基于R语言的excel合并操作/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://tanzicai.gitee.io" target="_blank">小谭的部落阁</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/excel/">excel</a><a class="post-meta__tags" href="/tags/%E6%96%87%E4%BB%B6%E6%93%8D%E4%BD%9C/">文件操作</a><a class="post-meta__tags" href="/tags/%E6%95%B0%E6%8D%AE%E5%90%88%E5%B9%B6/">数据合并</a><a class="post-meta__tags" href="/tags/R%E8%AF%AD%E8%A8%80/">R语言</a></div><div class="post_share"><div class="social-share" data-image="/img/BRLY.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2021/07/28/%E5%9F%BA%E4%BA%8EJava%E8%BF%9B%E8%A1%8Cexcel%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86/"><img class="prev-cover" src="/img/ERTH.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">基于Java语言的excel文件合成操作</div></div></a></div><div class="next-post pull-right"><a href="/2021/07/28/%E6%95%99%E5%B8%88%E8%B5%84%E6%A0%BC%E8%AF%81%E5%AF%BC%E8%AE%BA/"><img class="next-cover" src="/img/CSMS.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">教师资格证概论</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2021/07/28/基于Java进行excel数据处理/" title="基于Java语言的excel文件合成操作"><img class="cover" src="/img/ERTH.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-07-28</div><div class="title">基于Java语言的excel文件合成操作</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://gitee.com/tanzicai/drawingbed/raw/master/img/20210609205810.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">谭自财</div><div class="author-info__description">你别卷入世俗，我别沉迷初遇</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">35</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">50</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">12</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/tanzicai"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/tanzicai" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="https://gitee.com/tanzicai" target="_blank" title="Github"><i class="fab fa-git-square"></i></a><a class="social-icon" href="http://wpa.qq.com/msgrd?v=3&amp;uin=1728561744&amp;site=qq&amp;menu=yes" target="_blank" title="QQ"><i class="fas fa-qq"></i></a><a class="social-icon" href="mailto:1728561744@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">本站正在切换主题测试，如有错误提示，请联系我，谢谢</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BB%E8%A6%81%E5%AE%9E%E7%8E%B0%E6%95%88%E6%9E%9C"><span class="toc-number">1.</span> <span class="toc-text">主要实现效果</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E9%9C%80%E8%A6%81%E7%9A%84%E5%8C%85"><span class="toc-number">1.1.</span> <span class="toc-text">安装需要的包</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86"><span class="toc-number">1.2.</span> <span class="toc-text">数据处理</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%A4%9A%E4%B8%AAsheet%EF%BC%88%E5%B7%A5%E4%BD%9C%E8%A1%A8%EF%BC%89%E5%88%97%E5%90%8D%E7%9B%B8%E5%90%8C%E6%8C%89%E8%A1%8C%E5%90%88%E5%B9%B6"><span class="toc-number">1.3.</span> <span class="toc-text">多个sheet（工作表）列名相同按行合并</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%A4%9A%E4%B8%AA%E6%95%B0%E6%8D%AE%E8%A1%A8%E5%88%97%E5%90%8D%E4%B8%8D%E5%AE%8C%E5%85%A8%E7%9B%B8%E5%90%8C%EF%BC%8C%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BF%9E%E6%8E%A5-%E6%9C%AC%E6%96%87%E5%AE%9E%E7%8E%B0%E6%83%85%E5%86%B5"><span class="toc-number">1.4.</span> <span class="toc-text">多个数据表列名不完全相同，进行数据连接(本文实现情况)</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%A4%9A%E4%B8%AAsheet%E5%88%97%E5%90%8D%E4%B8%8D%E5%AE%8C%E5%85%A8%E7%9B%B8%E5%90%8C%EF%BC%8C%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BF%9E%E6%8E%A5-%E6%9C%AC%E6%96%87%E5%AE%9E%E7%8E%B0%E6%83%85%E5%86%B5"><span class="toc-number">1.5.</span> <span class="toc-text">多个sheet列名不完全相同，进行数据连接(本文实现情况)</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E4%BF%AE%E6%94%B9"><span class="toc-number">2.</span> <span class="toc-text">数据修改</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E5%8C%85%E5%8F%8A%E5%AF%BC%E5%85%A5%E6%95%B0%E6%8D%AE"><span class="toc-number">2.1.</span> <span class="toc-text">安装包及导入数据</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E9%A2%84%E5%A4%84%E7%90%86"><span class="toc-number">2.2.</span> <span class="toc-text">数据预处理</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%97%E5%90%8D%E9%87%8D%E5%91%BD%E5%90%8D"><span class="toc-number">2.2.1.</span> <span class="toc-text">列名重命名</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%A0%E9%99%A4%E7%BC%BA%E5%A4%B1%E5%80%BC"><span class="toc-number">2.3.</span> <span class="toc-text">删除缺失值</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%A4%84%E7%90%86%E6%97%A5%E6%9C%9F"><span class="toc-number">2.4.</span> <span class="toc-text">处理日期</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E6%8E%92%E5%BA%8F"><span class="toc-number">3.</span> <span class="toc-text">数据排序</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%9C%AC%E6%96%87%E4%BD%BF%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8C%85%E6%89%8B%E5%86%8C%E5%8F%82%E8%80%83%E5%9C%B0%E5%9D%80"><span class="toc-number"></span> <span class="toc-text">本文使用工具包手册参考地址</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%83%A8%E5%88%86%E5%8F%82%E8%80%83%E7%89%87%E6%AE%B5"><span class="toc-number"></span> <span class="toc-text">部分参考片段</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Overview"><span class="toc-number">0.1.</span> <span class="toc-text">Overview</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Installation"><span class="toc-number">0.2.</span> <span class="toc-text">Installation</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Usage"><span class="toc-number">0.3.</span> <span class="toc-text">Usage</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Packages"><span class="toc-number">0.4.</span> <span class="toc-text">Packages</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Code-of-Conduct"><span class="toc-number">0.5.</span> <span class="toc-text">Code of Conduct</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2022/02/10/%E5%B8%B8%E7%94%A8%E7%B1%BB/" title="Java常用类"><img src="https://gitee.com/tanzicai/file-pan/raw/master/img/20220209171157.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java常用类"/></a><div class="content"><a class="title" href="/2022/02/10/%E5%B8%B8%E7%94%A8%E7%B1%BB/" title="Java常用类">Java常用类</a><time datetime="2022-02-10T12:25:00.000Z" title="发表于 2022-02-10 20:25:00">2022-02-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/09/%E5%BC%82%E5%B8%B8/" title="Java异常"><img src="/img/survivors_v03_5120x2880.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java异常"/></a><div class="content"><a class="title" href="/2022/02/09/%E5%BC%82%E5%B8%B8/" title="Java异常">Java异常</a><time datetime="2022-02-09T13:25:00.000Z" title="发表于 2022-02-09 21:25:00">2022-02-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/09/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%BC%96%E7%A8%8B/" title="Java面向对象编程"><img src="/img/CTTN.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java面向对象编程"/></a><div class="content"><a class="title" href="/2022/02/09/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E7%BC%96%E7%A8%8B/" title="Java面向对象编程">Java面向对象编程</a><time datetime="2022-02-09T13:25:00.000Z" title="发表于 2022-02-09 21:25:00">2022-02-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/09/%E6%95%B0%E7%BB%84%E8%AF%A6%E8%A7%A3/" title="Java数组详解"><img src="/img/CNYN.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java数组详解"/></a><div class="content"><a class="title" href="/2022/02/09/%E6%95%B0%E7%BB%84%E8%AF%A6%E8%A7%A3/" title="Java数组详解">Java数组详解</a><time datetime="2022-02-09T13:25:00.000Z" title="发表于 2022-02-09 21:25:00">2022-02-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2022/02/09/%E6%96%B9%E6%B3%95%E8%AF%A6%E8%A7%A3/" title="Java方法详解"><img src="/img/WHT.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Java方法详解"/></a><div class="content"><a class="title" href="/2022/02/09/%E6%96%B9%E6%B3%95%E8%AF%A6%E8%A7%A3/" title="Java方法详解">Java方法详解</a><time datetime="2022-02-09T12:25:00.000Z" title="发表于 2022-02-09 20:25:00">2022-02-09</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('/img/BRLY.png')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By 谭自财</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">欢迎进入 <a href="https://tanzicai.gitee.io">小谭的部落阁</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"></div><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>